<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>修改广告 - bjyadmin</title>
    <link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap/dist/css/bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/animate.css/animate.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/font-awesome/css/font-awesome.min.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/simple-line-icons/css/simple-line-icons.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap-editable/css/bootstrap-editable.min.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/app/css/font.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/app/css/app.css" type="text/css" />
    <webuploadercss/>
</head>
<body>
<script src="__ADMIN_STATICS__/jquery/jquery.min.js"></script>
<script src="__ADMIN_STATICS__/bootstrap/dist/js/bootstrap.js"></script>
<div class="wrapper-md">
   <div class="panel panel-default">
    <div class="panel-heading">
        <a href="{:U('Admin/Index/welcome')}"><i class="fa fa-home"></i>&nbsp;首页&nbsp;</a>&gt;
        <a href="{:U('Admin/Ad/index')}">&nbsp;&nbsp;广告列表&nbsp;</a>&gt;&nbsp;&nbsp;修改广告
    </div>
    <div class="table-responsive">
        <form class="form-horizontal" action="{:U('Admin/Ad/edit')}" method="post">
            <input type="hidden" name="id" value="{$data['id']}" />
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div class="form-group m-b-none m-l-none m-r-none">
                <label class="col-sm-2 control-label" for="input-id-1">图片名：</label>
                <div class="col-sm-6">
                    <input type="text" class="form-control" name="name" value="{$data['name']}" data-form-un="1470118834084.755">
                </div>
            </div>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div class="form-group m-b-none m-l-none m-r-none">
                <label class="col-sm-2 control-label" for="input-id-1">位置：</label>
                <div class="col-sm-6">
                    <select name="pid" class="form-control">
                        <volist name="position" id="p">
                            <option value="{$p['id']}" <if condition="$data['pid'] eq $p['id']">selected</if>>{$p['name']}</option>
                        </volist>
                    </select>
                </div>
            </div>                    
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div class="form-group m-b-none m-l-none m-r-none">
                <label class="col-sm-2 control-label" for="input-id-1">状态：</label>
                <div class="col-sm-6">
                    <div class="radio">
                        <label class="i-checks i-checks-sm">
                            <input type="radio" name="status"value="1" <if condition="$data['status'] eq 1">checked</if>>
                            <i></i>显示
                        </label>
                        <label class="i-checks i-checks-sm">
                            <input type="radio" name="status" value="0" <if condition="$data['status'] eq 0">checked</if>>
                            <i></i>禁用
                        </label>
                    </div>
                </div>
            </div>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div class="form-group m-b-none m-l-none m-r-none">
                <label class="col-sm-2 control-label" for="input-id-1">连接地址：</label>
                <div class="col-sm-6">
                    <input type="text" class="form-control" name="mca" data-form-un="1470118834084.755">
                </div>
                <div class="col-sm-6 col-sm-offset-2">
                    <div class="radio">
                        <label class="i-checks i-checks-sm">
                            <input type="radio" name="mca_type" value="_blank" <if condition="$data['mca_type'] eq '_blank'">checked</if>>
                            <i></i>新窗口打开
                        </label>
                        <label class="i-checks i-checks-sm">
                            <input type="radio" name="mca_type" value="_self" <if condition="$data['mca_type'] eq '_self'">checked</if>>
                            <i></i>当前页面打开
                        </label>
                    </div>
                </div>
            </div>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div class="form-group m-b-none m-l-none m-r-none">
                <label class="col-sm-2 control-label" for="input-id-1">排序：</label>
                <div class="col-sm-6">
                    <input type="text" class="form-control" name="order_number" value="{$data['order_number']}" data-form-un="1470118834084.755">
                </div>
            </div>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div class="form-group m-b-none m-l-none m-r-none">
                <label class="col-sm-2 control-label" for="input-id-1">图片预览：</label>
                <div class="col-sm-6">
                    <img src="{$data['path']}" height="auto" width="100%" />
                </div>
            </div>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div class="form-group m-b-none m-l-none m-r-none">
                <label class="col-sm-2 control-label" for="input-id-1">上传图片：</label>
                <div class="col-sm-6">
                    <!-- 上传组件容器 开始-->
                    <div id="pic_upload" class="xb-uploader">
                        <div class="queueList">
                            <div class="placeholder">
                                <div class="filePicker"></div>
                                <p>选择广告图片</p>
                            </div>
                        </div>
                        <div class="statusBar" style="display:none;">
                            <div class="progress">
                                <span class="text">0%</span>
                                <span class="percentage"></span>
                            </div>
                            <div class="info"></div>
                            <div class="btns">
                                <div class="uploadBtn">开始上传</div>
                            </div>
                        </div>
                        <div class="attachment_list" style="display: none;">
                            <input name="path" type="hidden" value="{$data['path']}" />
                        </div>
                    </div>
                    <!-- 上传组件容器 结束-->
                </div>
            </div>
            <div class="line line-dashed b-b line-lg pull-in"></div>                    
            <div class="form-group m-l-none m-r-none">  
                <div class="col-sm-4 col-sm-offset-2">
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
            </div>
        </form>
    </div>
  </div>
</div>
<script src="__ADMIN_STATICS__
/webuploader-0.1.5/webuploader.js"></script>
<script src="__ADMIN_STATICS__
/webuploader-0.1.5/uploaderSf.js"></script>  
<script type="text/javascript">
$('#pic_upload').sfUpload({
    url:"{:U('Admin/Ad/ajax_upload')}",
    picker:'pic_upload',
    multiple:false,
    sizeLimit:1,
    success:function( data ) {
        $("input[name='path']").val(data.path);
        console.log(data);
    },
    error:function( err ) {
        console.info( err );    
    }
});
</script>
</body>
</html>
